import React,{useEffect,useState} from 'react'
import SeckillList from '../components/SeckillList'
import api from '../api'
export default function Home() {

  const [skillList,setSkillList]=useState([])
  useEffect(()=>{
    //向后端秒杀商品列表接口发送请求
    getSkillListApi()
  },[])

  //向后端获取秒杀列表的方法
  const getSkillListApi=async ()=>{
    const result=await api.skill.getSkillList()
    setSkillList(result.data.data)
  }
  return (
   
    <div>
        <SeckillList skillList={skillList}></SeckillList>
        
    </div>
  )
}
